import Dialog from 'com/dialog/index.vue'
import DelDialog from 'com/del-dialog/index.vue'
import { createApp } from 'vue'
export function message  (option)  {
    let defualtOption ={
        title: '提示',
        cancelText: '取消',
        submitText: '确定',
        content:'',
        loading:false,
        cancel:()=>{},
        submit:()=>{}
    }
    option = Object.assign(defualtOption, option)
    const app = createApp(Dialog, option)
    const div = document.createElement('div')
    app.mount(div)
    document.body.appendChild(div)
    const close = () => {
        app.unmount()
        document.body.removeChild(div)
    }
        return close
 }

// export default message
 
export function Delmessage (option)  {
    let defualtOption ={
        title: '提示',
        cancelText: '取消',
        submitText: '删除',
        content:'',
        loading:false,
        cancel:()=>{},
        submit:()=>{}
    }
    option = Object.assign(defualtOption, option)
    const app = createApp(DelDialog, option)
    const div = document.createElement('div')
    app.mount(div)
    document.body.appendChild(div)
    const close = () => {
        app.unmount()
        document.body.removeChild(div)
    }
        return close
 }

//  export default Delmessage